package com.configuration;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author fanxiao  2021/10/14
 * @since 1.0.0
 */
@Configuration
@Conditional(FunnyCondition.class)
@ComponentScan(basePackages = "com.condition")
@Slf4j
public class AppConfig {


	@Bean
	public Foo foo() {
		Foo foo = new Foo();
		log.info("foo() 方法的 foo hashcode:{}", foo.hashCode());
		return foo;
	}

	@Bean
	public Eoo eoo() {
		log.info("eoo() invoked...");
		Foo foo = foo();
		log.info("eoo() 方法的 foo hashcode:{}", foo.hashCode());
		return new Eoo();
	}
}
